package git.soulbgm.feign.controller;

import git.soulbgm.feign.pojo.User;
import git.soulbgm.feign.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author 贺瑞杰
 * @version V1.0
 * @date 2018-09-28 14:47
 * @description @FeignClient(name = "producer") 标明feign调用的微服务名称
 */
@RestController
public class DemoController {

    @Autowired
    private DemoService demoService;

    @RequestMapping(value = "/hello", method = RequestMethod.POST)
    String hello(User user) {
        return demoService.hello(user);
    }

    @RequestMapping(value = "hello2", method = RequestMethod.GET)
    public String hello2(@RequestParam Map<String, Object> map) {
        return demoService.hello2(map);
    }

    @RequestMapping(value = "/test", method = RequestMethod.GET)
    String test(String str){
        return demoService.test(str);
    }

}
